home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Add-Ons
/
After Dark
/
Twist 1.0b1
/
GraphicsModule.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-05
|
2KB
|
87 lines
/*
JustOvals.c
CodeWarior version.
This file provides a generic interface for writing a After Dark™ graphics module.
The function "main" is called by After Dark and passed four parameters:
storage: A Handle to memory you have allocated.
blankRgn: A region covering all screens.
message: A value indicating which function to call.
params: A pointer to a structure containing useful information.
To use it, write the five routines:
OSErr DoInitialize(Handle *storage, RgnHandle blankRgn, GMParamBlockPtr params);
OSErr DoClose(Handle storage, RgnHandle blankRgn, GMParamBlockPtr params);
OSErr DoBlank(Handle storage, RgnHandle blankRgn, GMParamBlockPtr params);
OSErr DoDrawFrame(Handle storage, RgnHandle blankRgn, GMParamBlockPtr params);
OSErr DoSetUp(RgnHandle blankRgn, short message, GMParamBlockPtr params);
For more information, consult the programmer's section of the manual.
The following people are all conspirators in this code:
Patrick Beard
Bruce Burkhalter
Colin Glassey
Andrew Armstrong
©1989-1995 Berkeley Systems, Inc.
*/
#include <QuickDraw.h>
#include "GraphicsModule_Types.h"
#include "ADTestbed.h"
#include "MessageHandlers.h"
#undef AD_TESTBED
#ifdef AD_TESTBED
pascal OSErr ADEntry(Handle *storage, RgnHandle blankRgn, short message, GMParamBlockPtr params)
#else
pascal OSErr main(Handle *storage, RgnHandle blankRgn, short message, GMParamBlockPtr params)
#endif
{
OSErr err=noErr;
/* dispatch message to appropriate routine. */
switch(message) {
case Initialize:
err = DoInitialize(storage, blankRgn, params);
break;
case Close:
err = DoClose(*storage, blankRgn, params);
break;
case Blank:
err = DoBlank(*storage, blankRgn, params);
break;
case DrawFrame:
err = DoDrawFrame(*storage, blankRgn, params);
break;
/* There are other messages that can be passed to you. We aren't going to handle them
but I've included them to make your life simpler.
case ModuleSelected:
err=DoSelected(*storage, blankRgn, params);
break;
case DoAbout:
err=DoAbout(*storage, blankRgn, params);
break;
*/
default: // Check to see if the user pressed a button
if(message>=ButtonMessage) {
err=DoButton(blankRgn, message, params);
}
break;
} /* end switch */
return err;
}